Hi, |
Re: Problem changing enumerations on attribute type
Yes this is tricky. You need to map the old values to the new. The AttrType "modify" takes a list arrays, the size of the arrays are the number of new enumerations.
int NumNew = 3 // we want to end up with 3 Enumerations
string Strings[NumNew] = {"A", "C", "D"}
int Values [NumNew] = {1, 2, 3} // whatever
int Colors [NumNew] = {0, 0, 0} // or is it "-1" for "no color"?
int Mapping[NumNew] = {0, 2, 3} // Old Enums A, B, C, D are in order 0, 1, 2, 3 respectively
// The "2" in the above line means "C" is now position 1 but was previously position 2.
|
Re: Problem changing enumerations on attribute type llandale - Fri Mar 15 12:15:40 EDT 2013
Yes this is tricky. You need to map the old values to the new. The AttrType "modify" takes a list arrays, the size of the arrays are the number of new enumerations.
int NumNew = 3 // we want to end up with 3 Enumerations
string Strings[NumNew] = {"A", "C", "D"}
int Values [NumNew] = {1, 2, 3} // whatever
int Colors [NumNew] = {0, 0, 0} // or is it "-1" for "no color"?
int Mapping[NumNew] = {0, 2, 3} // Old Enums A, B, C, D are in order 0, 1, 2, 3 respectively
// The "2" in the above line means "C" is now position 1 but was previously position 2.
Thank you Louie! I'm planning a retry (after fixing stuff by hand) using this technique. I would have never deduced this one from documentation! Best, Frank |
Re: Problem changing enumerations on attribute type lanef - Mon Mar 18 09:38:18 EDT 2013 |